home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
C
/
Snippets
/
Stuart's Tech Notes
/
Moving the mouse pointer.c
< prev
next >
Wrap
Text File
|
1994-12-10
|
930b
|
32 lines
// (C) 1992 Stuart Cheshire <cheshire@cs.stanford.edu>
// The user moves the mouse pointer with the mouse.
// A program moving the mouse pointer is stricly against Apple guidelines,
// and is guaranteed to annoy your users in 99% of cases.
//
// However, Bolo moves the mouse pointer when the map scrolls, so that the
// building cursor stays in the same place relative to the map, and amazingly,
// no one has flamed me for it. Not even anyone at Apple.
//
// So, it can be done, and here is how:
#include "StuTypes.h"
Point MTemp : 0x828;
Point RawMouse : 0x82C;
Point Mouse : 0x830;
char CrsrNew : 0x8CE;
char CrsrCouple : 0x8CF;
export void offset_mouse_location(short xoff, short yoff)
{
short statusregister = Disableinterrupts();
Mouse.h += xoff;
Mouse.v += yoff;
MTemp.h += xoff;
MTemp.v += yoff;
RawMouse.h += xoff;
RawMouse.v += yoff;
CrsrNew = CrsrCouple;
RestoreInterrupts(statusregister);
}